﻿<Window x:Class="FixSoft.CloudGround.Options"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Properties="clr-namespace:FixSoft.CloudGround.Properties"
        Title="{x:Static Properties:Resources.OptionsWindowTitle}" Height="480" Width="520" WindowStartupLocation="CenterScreen" Background="Transparent" MinWidth="400" MinHeight="350"
        SourceInitialized="WindowSourceInitialized" Loaded="Window_Loaded" Icon="/Fix%20soft%20CloudGround;component/CloudGround.ico">
    <DockPanel Background="{StaticResource TabControlBgBrush}" Margin="0,34,0,0">
        <Grid DockPanel.Dock="Bottom">
            <Rectangle Fill="#c1c2c3" VerticalAlignment="Top" Height="1" Margin="0,0,0,0"/>
            <Rectangle VerticalAlignment="Top" Height="4" Margin="0,1,0,0">
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Color="#AAc6c9cd" Offset="0"/>
                        <GradientStop Color="#e3e7ec" Offset="1"/>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,10">
                <Button Name="OkButton" Content="{x:Static Properties:Resources.OptionsOkButton}" MinWidth="75" Height="23" Margin="0,0,7,0" Click="OkButtonClick"/>
                <Button Name="CancelButton" Content="{x:Static Properties:Resources.OptionsCancelButton}" MinWidth="75" Height="23" Margin="0,0,7,0" Click="CancelButtonClick"/>
                <Button Name="ApplyButton" Content="{x:Static Properties:Resources.OptionsApplyButton}" MinWidth="75" Height="23" Margin="0,0,7,0" IsEnabled="False" Click="ApplyButtonClick"/>
            </StackPanel>
        </Grid>
        <TabControl Style="{StaticResource TabControlStyle}" Margin="0,-34,0,0">
            <TabItem Header="{x:Static Properties:Resources.OptionsGeneralTabHeader}" Style="{StaticResource TabItemStyle}">
                <ScrollViewer VerticalScrollBarVisibility="Auto" Background="White">
                    <StackPanel Orientation="Vertical" Margin="10">
                        <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsSearch}" Foreground="#083ca2"/>
                        <Separator Margin="0,0,0,10"/>
                        <TextBox Name="SearchBox" Text="{x:Static Properties:Resources.OptionsSearchBox}" FontStyle="Italic" Foreground="Gray"
                                     IsKeyboardFocusedChanged="SearchBoxIsKeyboardFocusedChanged" TextChanged="SearchBoxTextChanged" LostKeyboardFocus="SearchBox_LostKeyboardFocus" />
                        <StackPanel Name="FilterPanel">
                            <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsFilter}" Margin="0,15,0,0" Foreground="#083ca2"/>
                            <Separator Margin="0,0,0,10" Visibility="Visible"/>
                            <TextBlock Text="{x:Static Properties:Resources.OptionsFilterText}" TextWrapping="Wrap"/>
                            <TextBox Name="FilterBox" Text="{x:Static Properties:Resources.OptionsSearchBox}" 
                                     IsKeyboardFocusedChanged="SearchBoxIsKeyboardFocusedChanged" TextChanged="SearchBoxTextChanged"/>
                        </StackPanel>
                        <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsBehaviour}" Margin="0,15,0,0" Foreground="#083ca2"/>
                        <Separator Margin="0,0,0,10"/>
                        <TextBlock Text="{x:Static Properties:Resources.OptionsSelectProvider}"/>
                        <ComboBox Name="ProvidersBox" MinWidth="120" Margin="0,3,0,3" SelectionChanged="ComboBoxSelectionChanged"/>
                        <CheckBox Name="AutoDownloadCheckBox" Content="{x:Static Properties:Resources.OptionsDownloadAutomatically}" Click="CheckBoxClick"/>
                        <StackPanel Orientation="Horizontal" Margin="0,7,0,0" >
                            <TextBlock Text="{x:Static Properties:Resources.OptionsRefreshInterval}"/>
                            <TextBlock Name="RefreshIntervalValueTextBlock" Text="20 min." Margin="5,0,3,0" FontWeight="DemiBold"/>
                            <ComboBox SelectedIndex="1" Margin="10,0,0,0" Name="IMComboBox" SelectionChanged="IMComboBox_SelectionChanged">
                                <ComboBoxItem Content="Seconds" />
                                <ComboBoxItem Content="Minutes" />
                                <ComboBoxItem Content="Hours" />
                            </ComboBox>
                        </StackPanel>
                        <DockPanel>
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static Properties:Resources.OptionsLessUpdates}" Margin="0,0,7,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <TextBlock DockPanel.Dock="Right" Text="{x:Static Properties:Resources.OptionsMoreUpdates}" Margin="7,0,0,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <Slider Name="RefreshIntervalSlider" Margin="0,3,0,0" Value="20" TickPlacement="Both" TickFrequency="5" SmallChange="10" LargeChange="10"
                                        IsSnapToTickEnabled="True" IsDirectionReversed="True" ValueChanged="RefreshIntervalSliderValueChanged" IsEnabled="{Binding ElementName=AutoDownloadCheckBox, Path=IsChecked}" Minimum="1" Maximum="90" />
                        </DockPanel>
                        <CheckBox Name="LaunchOnStartUpCheckBox" Content="Launch program on Windows StartUp" IsChecked="True" Click="LaunchOnStartUpCheckBox_Click" />
                        <CheckBox Name="ShowWarningCheckBox" Content="{x:Static Properties:Resources.OptionsShowWarning}" IsChecked="True" Click="ShowWarningCheckBox_Click" />
                        <CheckBox Name="SkipLowResCheckBox" Content="{x:Static Properties:Resources.OptionsSkipLowRes}" Click="CheckBoxClick"/>
                        <CheckBox Name="GetMaxResCheckBox" Content="{x:Static Properties:Resources.OptionsGetMaxRes}" Click="CheckBoxClick"/>
                        <CheckBox Name="ChangeLogonBgCheckBox" Content="{x:Static Properties:Resources.OptionsChangeLogonBg}" Click="CheckBoxClick"/>
                        <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsCache}" Margin="0,15,0,0" Foreground="#083ca2"/>
                        <Separator Margin="0,0,0,10"/>
                        <CheckBox Name="ClearCacheCheckBox" Content="{x:Static Properties:Resources.OptionsClearCache}" Click="CheckBoxClick"/>
                        <TextBlock Name="ClearIntervalTextBlock" Text="{x:Static Properties:Resources.OptionsClearInterval}"  Margin="0,7,0,0"/>
                        <DockPanel>
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static Properties:Resources.OptionsOlder}" Margin="0,0,7,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <TextBlock DockPanel.Dock="Right" Text="{x:Static Properties:Resources.OptionsNewer}" Margin="7,0,0,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <Slider Name="ClearIntervalSlider" Margin="0,3,0,0" Value="20" TickPlacement="Both" Minimum="1" Maximum="12" TickFrequency="1" SmallChange="1" LargeChange="4"
                                        IsSnapToTickEnabled="True" IsDirectionReversed="True" ValueChanged="ClearIntervalSliderValueChanged" IsEnabled="{Binding ElementName=ClearCacheCheckBox, Path=IsChecked}"/>
                        </DockPanel>
                        <Button Name="ClearNowButton" Content="{x:Static Properties:Resources.OptionsClearNow}" Padding="10,0,10,0" Height="23" HorizontalAlignment="Right" Margin="0,7,0,0" Click="ClearNowButtonClick"/>
                        <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsLanguage}" Margin="0,-7,0,0" Foreground="#083ca2" Visibility="Collapsed"/>
                        <Separator Margin="0,0,0,10" Visibility="Collapsed" />
                        <ComboBox Name="LanguageComboBox" SelectionChanged="ComboBoxSelectionChanged" Visibility="Collapsed" />
                        <TextBlock Text="{x:Static Properties:Resources.OptionsRestart}" Margin="0,3,0,0" Foreground="Gray" Visibility="Collapsed" />
                    </StackPanel>
                </ScrollViewer>
            </TabItem>
            <TabItem Header="{x:Static Properties:Resources.OptionsAboutTabHeader}" Style="{StaticResource TabItemStyle}">
                <ScrollViewer VerticalScrollBarVisibility="Auto" Background="White">
                    <StackPanel Orientation="Vertical" Margin="10">
                        <Grid>
                            <StackPanel Orientation="Vertical">
                                <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsAbout}" Foreground="#083ca2"/>
                                <Separator/>
                                <Image Source="/Fix soft CloudGround;component/CloudGround.ico" VerticalAlignment="Top" HorizontalAlignment="Center" Opacity="1" Width="128"/>
                                <TextBlock Text="Fix soft CloudGround Beta 2" Margin="0,7,0,0"/>
                                <TextBlock><Run Text="{x:Static Properties:Resources.OptionsVersion}"/><Run Text=" "/><Run x:Name="BuildTag" Text="1.0.0.0"/></TextBlock>
                                <TextBlock Text="Copyright © Fix soft 2011"/>
                                <TextBlock Text="{x:Static Properties:Resources.OptionsCopyright}" TextWrapping="Wrap"/>
                            </StackPanel>
                        </Grid>
                    </StackPanel>
                </ScrollViewer>
            </TabItem>
        </TabControl>
    </DockPanel>
</Window>
